<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include  file="/WEB-INF/include/header.jsp"%>
  
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">
  
    <div class="panel panel-default x-panel x-panel-layout">
    
      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/user">用户管理</a></li>
          <li class="active">用户管理</li>
        </ol>
      </div>
    
      <div class="panel-body">
      
        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>
      
        <div class="col-xs-10 x-panel-layout-right">
          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>用户管理&nbsp;-&nbsp;线上体验课报名</span></h2>
            </div>
          </div>
          
          <div class="x-toolbar-wrapper top-margin-20 clearfix">
            <div class="btn-group pull-left">
              <a href="${ctx.host}/online-experience-sign-ups" class="btn btn-${empty handled ? 'success' : 'default'} x-btn btn-shadow btn-shadow-${empty handled ? 'success' : 'default'}">全部</a>
              <a href="${ctx.host}/online-experience-sign-ups?handled=true" class="btn btn-${handled ? 'success' : 'default'} x-btn btn-shadow btn-shadow-${handled ? 'success' : 'default'}">已处理</a>
              <a href="${ctx.host}/online-experience-sign-ups?handled=false" class="btn btn-${(not empty handled and !handled) ? 'success' : 'default'} x-btn btn-shadow btn-shadow-${(not empty handled and !handled) ? 'success' : 'default'}">待处理</a>
            </div>
            
            <div class="btn-group pull-right">
              <a href="${ctx.host}/online-experience-sign-ups/search?${empty queryString ? '' : queryString}" data-target="#search" data-toggle="modal" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
              </a>
              <a href="${ctx.host}/online-experience-sign-ups/export-view" data-target="#export" data-toggle="modal" class="btn btn-default x-btn btn-shadow btn-shadow-default">
                <i class="glyphicon glyphicon-floppy-save"></i>&nbsp;&nbsp;导出
              </a>
            </div>
          </div>
          
          <table class="table table-striped table-hover x-table bottom-margin-20">
            <thead>
              <tr>
                <th>姓名</th>
                <th>微信号</th>
                <th>手机号</th>
                <th>身高</th>
                <th>体重</th>
                <th>三围（胸围,腰围,臀围）(cm)</th>
                <th>运动强度</th>
                <th>报名时间</th>
                <c:if test="${empty handled or handled}">
                  <th>处理时间</th>
                  <th>备注</th>
                </c:if>
                <c:if test="${empty handled or !handled}">
                  <th class="text-center">操作</th>
                </c:if>
              </tr>
            </thead>
            <tbody>
              <c:choose>
                <c:when test="${empty experiences}">
                  <tr>
                    <td class="text-center" colspan="${empty handled ? 11 : (handled ? 10 : 9)}">暂无符合要求的结果</td>
                  </tr>
                </c:when>
                <c:otherwise>
                  <c:forEach var="experience" items="${experiences}">
                    <tr>
                      <td>${experience.name}</td>
                      <td>${experience.wechat}</td>
                      <td>${experience.mobile}</td>
                      <td>${experience.height}</td>
                      <td>${experience.weight}</td>
                      <td>${experience.bust},${experience.waist},${experience.hips}</td>
                      <td>${experience.fitnessFrequency.onlineDescription}</td>
                      <td><fmt:formatDate value="${experience.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                      <c:if test="${empty handled or handled}">
                        <td><fmt:formatDate value="${experience.handleTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td style="max-width: 200px;">${experience.remark}</td>
                      </c:if>
                      <c:if test="${empty handled or !handled}">
                        <td class="text-center">
                          <c:if test="${empty experience.handleTime}"><a href="${ctx.host}/online-experience-sign-ups/${experience.id}/handle" title="处理" data-target="#handle" data-toggle="modal">处理</a>&nbsp;&nbsp;</c:if>
                        </td>
                      </c:if>
                    </tr>
                  </c:forEach>
                </c:otherwise>
              </c:choose>
            </tbody>
          </table>
          
          <div class="form-horizontal clearfix">
            
            <jsp:include page="/WEB-INF/include/page.jsp">
              <jsp:param name="url" value="online-experience-sign-ups" />
              <jsp:param name="queryString" value="${queryString}" />
            </jsp:include>
            
          </div>
          
        </div>
      </div>
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource root="${ctx.resource}/build" type="script" src="js/page/user/online-sign-up-list.js">
    <script type="text/javascript">
      require(['page/user/online-sign-up-list'], function(page) {
        page.init({
          handled: '${handled}'
        })
      })
    </script>
  </d:resource>
  
</body>
</html>